package com.shujia.udtf;

import com.aliyun.odps.udf.ExecutionContext;
import com.aliyun.odps.udf.UDFException;
import com.aliyun.odps.udf.UDTF;
import com.aliyun.odps.udf.annotation.Resolve;

/*
a,1,2,3,4,5,6,7,8,9,10,11,12
b,13,14,15,16,17,18,19,20,21,22,23,24
c,25,26,27,28,29,30,31,32,33,34,35,36


a 0时 1
a 2时 2
...
 */
// TODO define input and output types, e.g. "string,string->string,bigint".
@Resolve({"string,*->string,string,string"})
public class MyUDTFDemo1 extends UDTF {
    @Override
    public void process(Object[] args) throws UDFException {
        // TODO
        //创建一个数组，存储一行三列的数据
        //因为接收了13列的数据，args的长度是13 索引最大值是12
        //第一列是监测点编号
        String id = args[0].toString();
        for (int i = 1, j = 0; i < args.length; i++, j += 2) {
            forward(id,j + "时",args[i].toString());
        }
    }

}